---
id: 65549561463f0016876e852c
title: Step 60
challengeType: 20
dashedName: step-60
---

# --description--

Since your key is shorter than the text that you will have to encrypt, you will need to repeat it to generate the whole encrypted text.
At the beginning of your function body, declare a `key_index` variable and set it to zero.

# --hints--

You should declare a variable called `key_index` at the beginning of your function body.

```js
const commentless_code = __helpers.python.removeComments(code);
const {function_body} = __helpers.python.getDef(commentless_code, "vigenere");
assert(function_body.match(/^\s*key_index\s*=/));
```

You should assign `0` to your `key_index` variable.

```js
const commentless_code = __helpers.python.removeComments(code);
const {function_body} = __helpers.python.getDef(commentless_code, "vigenere");   
assert(function_body.match(/key_index\s*=\s*0/));
```

Your code contains invalid syntax and/or invalid indentation.

```js
({test: () => assert(true) })
```

# --seed--

## --seed-contents--

```py
--fcc-editable-region--
text = 'Hello Zaira'
custom_key = 'python'

def vigenere(message, key):
    alphabet = 'abcdefghijklmnopqrstuvwxyz'
    encrypted_text = ''

    for char in message.lower():
        if char == ' ':
            encrypted_text += char
        else:
            index = alphabet.find(char)
            new_index = (index + offset) % len(alphabet)
            encrypted_text += alphabet[new_index]
    print('plain text:', message)
    print('encrypted text:', encrypted_text)
--fcc-editable-region--
```
